﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp2
{
    class Program
    {
        static int sum;
        static int shu;
        static int ying;
        static int ping;
        struct juese
        {
            public string name;
            public string name1;
            public string name2;

        }
        struct caijuan
        {
            public string jiandao;
            public string shitou;
            public string bu;

        }

        static void Main(string[] args)
        {

            Text1();
        }
        public static void Text1()
        {
            Console.WriteLine("游戏开始");
            caijuan cq = new caijuan();
            cq.shitou = "石头";
            cq.jiandao = "剪刀";
            cq.bu = "布";
            juese js = new juese();
            js.name = "黑";
            js.name1 = "白";
            js.name2 = "空";

            Console.WriteLine("出拳规则:{0},{1},{2}", cq.shitou, cq.jiandao, cq.bu);
            Console.WriteLine("请选择对方角色:{0},{1},{2}", js.name, js.name1, js.name2);
            string key = Console.ReadLine();
            Console.WriteLine("请输入你的姓名");
            string ming = Console.ReadLine();
            switch (key)
            {
                case "黑":
                    Text2();
                    break;
                case "白":
                    Text2();
                    break;
                case "空":
                    Text2();
                    break;
                default:
                    Text2();
                    break;
            }

        }
        public static void Text6()
        {
            Console.WriteLine("是否开始下一轮");
            int a = int.Parse(Console.ReadLine());
            switch (a)
            {
                case 1:
                    Text2();
                    break;
                case 2:
                    Console.WriteLine("次数{0}", sum);
                    Console.WriteLine("赢次数{0}", ying);
                    Console.WriteLine("输次数{0}", shu);
                    Console.WriteLine("平次数{0}", ping);
                    if (ying>shu)
                    {
                        Console.WriteLine("九龙拉棺，泰山封禅");
                    }
                    if ( shu<ying)
                    {
                        Console.WriteLine("这你都能输，去给华子嗦牛子去吧");
                    }
                    if (shu == ying)
                    {
                        Console.WriteLine("高手切磋，点到为止");
                    }
                    Text6();
                    break;
                default:
                    break;
            }
        }
        //1 石头 2剪刀 3布
        public static void Text2()
        {
            Random r = new Random();
            int s = r.Next(1, 4);
            Console.WriteLine("请选择你要出什么");
            int key = int.Parse(Console.ReadLine());
            switch (key)
            {
                case 1://石头
                    Text3();
                    break;
                case 2://剪刀
                    Text4();
                    break;
                case 3://布
                    Text5();
                    break;
                default:
                    break;
            }

        }
        public static void Text3()
        {
            Random r = new Random();
            int s = r.Next(1, 4);
            if (s == 1)//石头对石头
            {
                Console.WriteLine("石头");
                Console.WriteLine("石头");
                Console.WriteLine("平局");
                sum += 1;
                ping += 1;
                Text6();
            }
            if (s == 2)//石头对剪刀
            {
                Console.WriteLine("石头");
                Console.WriteLine("剪刀");
                Console.WriteLine("赢");
                ying += 1;
                sum += 1;
                Text6();
            }
            if (s == 3)//石头对
            {
                Console.WriteLine("石头");
                Console.WriteLine("布");
                Console.WriteLine("输");
                sum += 1;
                shu += 1;
                Text6();
            }
        }
        public static void Text4()
        {
            Random r = new Random();
            int s = r.Next(1, 4);
            if (s == 2)//剪刀对剪刀
            {
                Console.WriteLine("剪刀");
                Console.WriteLine("剪刀");
                Console.WriteLine("平局");
                sum += 1;
                ping += 1;
                Text6();
            }
            if (s == 3)//剪刀对布
            {
                Console.WriteLine("剪刀");
                Console.WriteLine("布");
                Console.WriteLine("赢");
                ying += 1;
                sum += 1;
                Text6();
            }
            if (s == 1)//剪刀对石头
            {
                Console.WriteLine("剪刀");
                Console.WriteLine("石头");
                Console.WriteLine("输");
                sum += 1;
                shu += 1;
                Text6();
            }
        }
        public static void Text5()
        {
            Random r = new Random();
            int s = r.Next(1, 4);
            if (s == 1)//石头对石头
            {
                Console.WriteLine("布");
                Console.WriteLine("石头");
                Console.WriteLine("赢");
                ying += 1;
                sum += 1;
                Text6();
            }
            if (s == 2)//石头对剪刀
            {
                Console.WriteLine("布");
                Console.WriteLine("剪刀");
                Console.WriteLine("输");
                sum += 1;
                shu += 1;
                Text6();
            }
            if (s == 3)//石头对布
            {
                Console.WriteLine("布");
                Console.WriteLine("布");
                Console.WriteLine("平");
                sum += 1;
                ping += 1;
                Text6();
            }
        }

    }
}
